<html>
<head><meta charset="utf-8"><title>rust-analyzer code completion for librustdoc · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html">rust-analyzer code completion for librustdoc</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="231349761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231349761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nixon Enraght-Moony <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231349761">(Mar 22 2021 at 17:18)</a>:</h4>
<blockquote>
<p>add to that the package metadata for rust-analyzer,</p>
</blockquote>
<p>How do you do this?</p>



<a name="231350583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231350583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231350583">(Mar 22 2021 at 17:22)</a>:</h4>
<p><span class="user-mention" data-user-id="344082">@Nelson J Morais</span> could you make a pr upstreaming that change?</p>



<a name="231351161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231351161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231351161">(Mar 22 2021 at 17:26)</a>:</h4>
<p>yes I'll make it as soon I get out of a work meeting.</p>



<a name="231351268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231351268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231351268">(Mar 22 2021 at 17:27)</a>:</h4>
<p><span class="user-mention" data-user-id="268539">@Nixon Enraght-Moony</span>  ill reply to you soon to help you out. can't right now.</p>



<a name="231367886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231367886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231367886">(Mar 22 2021 at 19:14)</a>:</h4>
<p><span class="user-mention" data-user-id="268539">@Nixon Enraght-Moony</span> so regarding rust-analyzer</p>



<a name="231368125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231368125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231368125">(Mar 22 2021 at 19:16)</a>:</h4>
<p>and code completion while hacking librustdoc</p>



<a name="231368349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231368349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231368349">(Mar 22 2021 at 19:17)</a>:</h4>
<p>you can add the following to <code>Cargo.toml</code> of librustdoc<br>
<code>
[package.metadata.rust-analyzer]
rustc_private = true
</code></p>



<a name="231368508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231368508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231368508">(Mar 22 2021 at 19:18)</a>:</h4>
<p>after that you tell RA where your rust repo source code is with: (I'm using vscode here)</p>



<a name="231368894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231368894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231368894">(Mar 22 2021 at 19:20)</a>:</h4>
<p>by setting the rustcSource of RA in your settings.json like this<br>
<code>
"rust-analyzer.rustcSource": "d:\\Code\\rust\\rust\\Cargo.toml",
// ...
</code></p>



<a name="231368923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231368923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231368923">(Mar 22 2021 at 19:21)</a>:</h4>
<p>point it to the Cargo.toml of the rust repo</p>



<a name="231369519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231369519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231369519">(Mar 22 2021 at 19:23)</a>:</h4>
<p>and you should start to get code completion for most of the code in librustdoc.<br>
take note that the rustc_private key of RA will work for all projects/libs, modules, etc that have the<br>
<strong> #![feature(rustc_private)] </strong> in it.</p>



<a name="231369726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231369726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231369726">(Mar 22 2021 at 19:24)</a>:</h4>
<p>I hope it help</p>



<a name="231372332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/rust-analyzer%20code%20completion%20for%20librustdoc/near/231372332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nelson J Morais <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/rust-analyzer.20code.20completion.20for.20librustdoc.html#231372332">(Mar 22 2021 at 19:39)</a>:</h4>
<p>for the record, i've opened PR to add <code>rustc_private = true</code> to <code>Cargo.toml</code> here <a href="https://github.com/rust-lang/rust/pull/83389">https://github.com/rust-lang/rust/pull/83389</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>